window.onload=function(){
    let mydiv=document.getElementById("mydiv")
    console.log(mydiv)
    if(mydiv instanceof HTMLElement){
        mydiv.style.backgroundColor="red"
    }
}